<div id="products">
<table class="table table-striped table-bordered">
  <tr>
    <th><%= sortable "item_number" %></th>
    <th>Description</th>
    <th><%= sortable "category_id","Category" %> </th>
    <th>Quantity </th>
    <th></th>    
  </tr>

<% @products.each do |product| %>
  <tr>
    <td><%= link_to product.item_number, product %>    </td>
    <td><%= product.description %></td>
    <td><%= product.category.name %></td>
    <td><%= product.total_quantity %></td>
    <td><%= link_to 'Show', product %>
    <%= link_to 'Edit', edit_product_path(product) %>
    <%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>

</table>
<%= will_paginate @products %>

</div>